<?php
class Main extends AppModel
{

	public $name = 'Main';
	public $hasAndBelongsToMany = array(
		'Recipe' => array(
			'className' => 'Recipe',
			'joinTable' => 'mains_recipes',
			'foreignKey' => 'main_id',
			'associationForeignKey' => 'recipe_id',
			'unique' => true,
			
			),
		); // end many - many

	public $validate = array(
		'title' => array(
			'required' => array(
				'rule' => 'notEmpty',
				'message' => 'Your title is required',
				),
			'duplicate'	=> array(
				'rule'	=> 'isUnique',
				'message'	=> 'A title already exists',
			),
		),

	); // end validate
}

?>